package com.lingshu.app.database.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.lingshu.app.database.bean.WallPaperBean;

import java.util.List;

import io.reactivex.Completable;
import io.reactivex.Flowable;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2023/12/27 14:30
 * @Description
 */
@Dao
public interface WallPaperDao {
    @Query("SELECT * FROM wallpapers")
    Flowable<List<WallPaperBean>> getAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Completable insertAll(List<WallPaperBean> wallPapers);

    @Query("DELETE FROM wallpapers")
    Completable deleteAll();
}
